package com.candy.service.impl;

import com.candy.bean.DishInfo;
import com.candy.dao.DishInfoMapper;
import com.candy.service.SaveDishInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SaveDishInfoServiceImpl implements SaveDishInfoService {
    @Autowired
    DishInfoMapper dishInfoMapper;
    @Override
    public int saveDishInfo(DishInfo dishInfo) {
        if(dishInfo.getDishId()!=null){
            return dishInfoMapper.updateByPrimaryKeySelective(dishInfo);
        }
        else return dishInfoMapper.insertSelective(dishInfo);
    }
}
